#ifndef __DUNE_EQUATION_SHALLOWWATER_HH__
#define __DUNE_EQUATION_SHALLOWWATER_HH__
#include "equation-base.hh"
#include <dune/common/parametertreeparser.hh>

namespace Dune {
  namespace Equation {
    template<int dim>
    class ShallowWater_: public EquationBase{};
    template<int dim>
    using ShallowWater = ShallowWater_<dim>;

    template<>
    class ShallowWater_<1> : public EquationBase{
    public:
      static constexpr int dim = 1;
      static constexpr int nvar = 2;
      ShallowWater_<1>(Dune::ParameterTree& ptree);
      virtual ~ShallowWater_<1>();  
      void get_equation_flux(int whichdim, double* fequ, double* var);
      double local_max_eigenvalue(double* var);
      void set_equ_paras(Dune::ParameterTree& ptree);
    private:
      void get_1d_fx(double* fequ, double* var);
    };

    template<>
    class ShallowWater_<2> : public EquationBase{
    public:
      static constexpr int dim = 2;
      static constexpr int nvar = 3;
      ShallowWater_<2>(Dune::ParameterTree& ptree);
      virtual ~ShallowWater_<2>();  
      void get_equation_flux(int whichdim, double* fequ, double* var);
      double local_max_eigenvalue(double* var);
      void set_equ_paras(Dune::ParameterTree& ptree);
    private:
      void get_2d_fx(double* fequ, double* var);
      void get_2d_fy(double* fequ, double* var);
    };

    template<>
    class ShallowWater_<3> : public EquationBase{
    public:
      static constexpr int dim = 3;
      static constexpr int nvar = 4;
      ShallowWater_<3>(Dune::ParameterTree& ptree);
      virtual ~ShallowWater_<3>();  
      void get_equation_flux(int whichdim, double* fequ, double* var);
      double local_max_eigenvalue(double* var);
      void set_equ_paras(Dune::ParameterTree& ptree);
    private:
      void get_3d_fx(double* fequ, double* var);
      void get_3d_fy(double* fequ, double* var);
      void get_3d_fz(double* fequ, double* var);        
    };
  } // Equation
} // Dune
#endif // __DUNE_EQUATION_SHALLOWWATER_HH__
